Cognitoware.Robotics.dll
Class DistributionValueMap<T>
T: The type of the values whose probabilities are represented in the distribution.
Implemented Interfaces
Summary
A discrete distribution that uses a Dictionary to map values to probabilities.
Constructor Summary
Creates a empty distribution.
Create a uniform distribution across the values in the parameter iterator.
Create a distribution a single value at 100%.
Create a distribution with two values.
Method Summary
AliasAs()
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
Equals(Object)
Inherited from System.Object
Finalize()
Inherited from System.Object
GetEntropy()
Inherited from Cognitoware.Mathematics.Probability.Discrete.DiscreteDistribution
GetEntropy(IEnumerable<T>)
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
GetHashCode()
Inherited from System.Object
GetType()
Inherited from System.Object
MemberwiseClone()
Inherited from System.Object
Normalizes the distribution so that the sum of probabilities over X sums to one.
Returns the probability of a discrete event or the probability density of a continuous event.
Mutiplies this MappedDistribution by a MappedDistribution to mean in a new MappedDistribution.
Selects a random value from the distribution with a probability consistent with the distribution.
Maps values of T to a probability value.
Creates a string representation of the matrix.
Details
A discrete distribution that uses a Dictionary to map values to probabilities.
Constructor Details
public DistributionValueMap()
Creates a empty distribution.
public DistributionValueMap(IEnumerable<T> domain)
Create a uniform distribution across the values in the parameter iterator.
Parameters:
domain
- An iterator across all values for the distribution.
public DistributionValueMap(T t0)
Create a distribution a single value at 100%.
Parameters:
t0
- The first value of T.
public DistributionValueMap(T t0, Double v0, T t1, Double v1)
Create a distribution with two values.
Parameters:
t0
- The first value of T.
v0
- The probability of the first value of T.
t1
- The second value of T.
v1
- The probability of the second value of T.
Method Details
public void Normalize()
Normalizes the distribution so that the sum of probabilities over X sums to one.
public override Double ProbabilityOf(T t)
Returns the probability of a discrete event or the probability density of a continuous event.
Simply looks up the specified value in the backing Dictionary.
Parameters:
t
- The values whose probability is returned.
public final virtual DistributionValueMap<T> Product(DistributionValueMap<T> that)
Mutiplies a MappedDistribution by a MappedDistribution to mean in a new MappedDistribution.
The operation multiplies the probabilities of each value of T.
Product is used to collapse distribution representations during Bayesian inferencing.
Parameters:
that
- The second operand in the multiplication.
Returns:
A new binomial combining the information from the two binomial arguments.
public override T Sample(Random select)
Selects a random value from the distribution with a probability consistent with the distribution.
Parameters:
select
- A random number generator used to select the value.
public void Set(T t, Double p)
Maps values of T to a probability value.
Parameters:
t
- The value whose probability is being calculated.
p
- The probability of t.
public override String ToString()
Creates a string representation of the matrix.
Returns:
A string representation of the matrix.